# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=kcalc
pkgver=23.08.4
pkgrel=0
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://kde.org/applications/utilities/org.kde.kcalc"
pkgdesc="Scientific Calculator"
license="GPL-2.0-or-later"
makedepends="
	extra-cmake-modules
	gmp-dev
	kconfig5-dev
	kconfigwidgets5-dev
	kcrash5-dev
	kdoctools5-dev
	kguiaddons5-dev
	ki18n5-dev
	kinit5-dev
	knotifications5-dev
	kxmlgui5-dev
	mpfr-dev
	qt5-qtbase-dev
	samurai
	"
_repo_url="https://invent.kde.org/utilities/kcalc.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/kcalc-$pkgver.tar.xz"
subpackages="$pkgname-doc $pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
7d4d7400d54bfe531da662f60f4c42a09427f264eb7d5cbb617211ad7c5686e117ba4fd687bcaf99d158ae4250026605bcc9101b2fad4f741709c9bfcef89b71  kcalc-23.08.4.tar.xz
"
